package com.seres.backend.admin;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class TestReader {
	public static void main(String[] args){
		try {
			FileInputStream fileInputStream = new FileInputStream("SERES.xlsx");
			XSSFWorkbook workbook = new XSSFWorkbook(fileInputStream);
			
			List<Integer> stakeholderIds = new ArrayList<Integer>();
			stakeholderIds.add(1);
			XSSFSheet worksheetMessages = workbook.getSheet("messages");
			MessagesParser messagesParser = new MessagesParser(worksheetMessages, stakeholderIds);
			messagesParser.parse();
			
//			XSSFSheet worksheetGameParameters = workbook.getSheet("game parameters");
//			GameParametersParser gameParametersParser = new GameParametersParser(worksheetGameParameters);
//			gameParametersParser.parse();
			
//			XSSFSheet worksheetAces = workbook.getSheet("aces");
//			AcesParser acesParser = new AcesParser(worksheetAces);
//			acesParser.parse();
			
//			XSSFSheet worksheetModules = workbook.getSheet("scenarios & answers");
//			ScenariosAndAnswersParser scenariosAndAnswersParser = new ScenariosAndAnswersParser(worksheetModules);
//			scenariosAndAnswersParser.parse();	
			
//			XSSFSheet worksheetModules = workbook.getSheet("modules");
//			ModulesParser modulesParser = new ModulesParser(worksheetModules);
//			modulesParser.parse();
			
//			XSSFSheet worksheetStakeholders = workbook.getSheet("stakeholders");
//			StakeholdersParser parser = new StakeholdersParser(worksheetStakeholders);
//			parser.parse();
			
//			XSSFSheet worksheetIndices = workbook.getSheet("indices");
//			IndicesParser indicesParser = new IndicesParser(worksheetIndices);
//			indicesParser.parse();
			
//			XSSFRow row1 = worksheet.getRow(3);
//			XSSFCell cellA1 = row1.getCell(2);
//			String a1Val = cellA1.getStringCellValue();
//			System.out.println(cellA1.getCellType());
//			System.out.println(row1.getCell(1).getCellType());
//
//
//			System.out.println("A1: " + a1Val);

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
